|
![](/i/fill.gif) |
Consider the code below:
box{x,x}
#macro Mother(Input)
#local Var = Input;
Child()
#end
#macro Child()
#local Var = Var+1; // line 7
Var
#end
#declare Number = Mother(1);
#debug str(Number,0,0)
It generates an error at line 7.
But if the Child macro is changed to:
#macro Child()
#local Var2 = Var+1; // line 7
Var2
#end
The code works fine. That is, the mother variable "Var" is only accessible
if it is not currently being assigned at a lower level. But I thought a
variable was not supposed to interfere with anything before the assignment
was completed (semi-colon reached) ? Or is it?
On an unrelated note: Isn't there any way I can make the child macro handle
and update a variable created in the mother macro, besides making the
variable global? I'm afraid not?
Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
![](/i/fill.gif) |